END=../src/libend
INX=../src/indexador
XML=../src/libendio
MAIN=..

all: newall

scanner: palavras.l $(INX)/indexador_end.c
	flex  -o palavrasl.c palavras.l
	gcc -g -Wall -o $(MAIN)/scanner-index palavrasl.c $(INX)/indexador_end.c -DSCANNER -lfl -L$(MAIN) -lend -lendio -I$(END) -I$(XML) -I /usr/include/libxml2

cleanscanner: $(MAIN)/scanner-index
	rm $(MAIN)/scanner-index

newall: palavras.l parser.y
	flex -o palavrasl.c palavras.l
	bison -o parsery.c parser.y -d
	gcc -g -Wall -o parser-palavras parsery.c palavrasl.c -lgdsl -I$(END) -I . -DPALAVRAS -lfl

oldall:
	bison parser.y
	gcc -g -Wall -o parser parser.tab.c -lpq -lgdsl -I../src/libend $(LIB)

oldd:
	bison parser.y
	gcc -g -Wall -o parser parser.tab.c -lpq -lgdsl -I../src/libend -DDEBUG $(LIB)

clean:
	rm parser
